Copy Code <html><head><title>Test</title></head>
<body vlink="purple" alink="red">
<basefont color="darkgreen">
This is a link <a HREF="test.asp">test</a>!
<br><br>
Some text, some more, some more.<img
src="toolbar.gif" width="100" height="31" border="0" align="right">Some
more, some more, some more.
<br><br>
<xml id="xmlTitles" src="http://www.businessanyplace.net/pubs?SQL=select+*+from
+titles+for+xml+auto&root=titlelist"></xml>
<span id="divTitleCombo"></span>
<input type="button" value="Get" onclick="javascript:loadTitle();">
  </tr>
</table>
<br><br>
<table cellspacing="0" cellpadding="0" border="0">
  <tr>
    <td valign="top">Title: </td>
    <td valign="top"><span id="divTitleName"></span></td>
  </tr>
  <tr>
    <td valign="top">Type: </td>
    <td valign="top"><span id="divTitleType"></span></td>
  </tr>
  <tr>
    <td valign="top">Price: </td>
    <td valign="top"><span id="divTitlePrice"></span></td>
  </tr>
</table>
<br>
<script for="window" event="onload">
  var selectHTML = "<select name=\"cboTitle\" size=\"1\">\n" +
        "<option value=\"0\" selected>Select title</option>\n";
  var root = xmlTitles.documentElement;
  var listTitles =  root.selectNodes("//titlelist/*");
  var nodeTitle;
  var i;
  for (i = 0 ; i < listTitles.length; i++) {
    nodeTitle = listTitles.item(i);
    selectHTML += "<option value=\"" +
      nodeTitle.attributes.getNamedItem("title_id").value + "\">" +
      nodeTitle.attributes.getNamedItem("title").value + "</option>";
   }
  selectHTML += "</select>\n";
  divTitleCombo.innerHTML = selectHTML;
</script>
<script>
void function loadTitle() {
  if (cboTitle.value == "0") {
    alert("Select a title in the list!");
    return;
  }
  var root = xmlTitles.documentElement;
  var nodeTitle =  root.selectSingleNode("//titles[@title_id=\"" +
                   cboTitle.value + "\"]");
  divTitleName.innerHTML = "<font color=\"blue\">" +
    nodeTitle.attributes.getNamedItem("title").value + "</font>";
  divTitleType.innerHTML = "<font color=\"blue\">" +
    nodeTitle.attributes.getNamedItem("type").value + "</font>";
  if (nodeTitle.attributes.getNamedItem("price") != null) 
    divTitlePrice.innerHTML = "<font color=\"blue\">" +
      nodeTitle.attributes.getNamedItem("price").value + "</font>";
  else
    divTitlePrice.innerHTML = "<font color=\"blue\">?</font>";
}
</script>
</body></html>